/**
 */
package generalbookings.impl;

import generalbookings.Capacity;
import generalbookings.GeneralbookingsPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Capacity</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link generalbookings.impl.CapacityImpl#getNumResources <em>Num Resources</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CapacityImpl extends PropertyImpl implements Capacity {
	/**
	 * The default value of the '{@link #getNumResources() <em>Num Resources</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumResources()
	 * @generated
	 * @ordered
	 */
	protected static final int NUM_RESOURCES_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getNumResources() <em>Num Resources</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumResources()
	 * @generated
	 * @ordered
	 */
	protected int numResources = NUM_RESOURCES_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CapacityImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GeneralbookingsPackage.Literals.CAPACITY;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getNumResources() {
		return numResources;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNumResources(int newNumResources) {
		int oldNumResources = numResources;
		numResources = newNumResources;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GeneralbookingsPackage.CAPACITY__NUM_RESOURCES, oldNumResources, numResources));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GeneralbookingsPackage.CAPACITY__NUM_RESOURCES:
				return getNumResources();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GeneralbookingsPackage.CAPACITY__NUM_RESOURCES:
				setNumResources((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GeneralbookingsPackage.CAPACITY__NUM_RESOURCES:
				setNumResources(NUM_RESOURCES_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GeneralbookingsPackage.CAPACITY__NUM_RESOURCES:
				return numResources != NUM_RESOURCES_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (numResources: ");
		result.append(numResources);
		result.append(')');
		return result.toString();
	}

} //CapacityImpl
